import { createStore } from 'vuex'
const store = createStore({
	state: {
		loginInfo: {},
		iStatusBarHeight: 24,
		token: '',
		userInfo: {},
		emailType:1,//1是个人 2是邮箱
		emailInfo:{},//当前登录邮箱
	},
	mutations: {
		//激活信息
		SET_INFO(state, info) {
			state.loginInfo = info['loginInfo']
			state.token = info['token'].token
		},
		//动态获取通知栏目的高度
		CHANGE_STATUS_BAR(state, nums) {
			state.iStatusBarHeight = nums
		},
		//存储个人信息
		SET_USER_INFO(state, userInfo) {
			state.userInfo = userInfo
		},
		//存储个人信息
		SET_EMAIL_TYPE(state, emailType) {
			state.emailType = emailType
		},
		//存储当前邮箱信息
		SET_EMAIL_INFO(state, emailInfo) {
			state.emailInfo = emailInfo
		}
	}
})

export default store
